const defaultState={
    token:"",
    userInfo:{name:"张三",age:""}

}

export default (state=defaultState,action:any)=>{


    console.log(99999999,action);

    if(action.type==="UPDATETOKEN"){

        let newState=JSON.parse(JSON.stringify(state));
        newState.token=action.val;
        return newState;

    }

    if(action.type==="UPDATENAME"){

        let newState=JSON.parse(JSON.stringify(state));
        newState.userInfo.name=action.val;
        return newState;

    }

   return state;

}